package com.aa;

import com.aa.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class AgentDetail extends Activity {
	  String msg;
	  String title;
	  int type;

	  private void getString()
	  {
	    switch (type)
	    {
	    default:
	      return;
	    case 1:
	      this.title = getString(R.string.agent_fangfa);
	      this.msg = getString(R.string.agent_fangfa_msg);
	      return;
	    case 2:
	      this.title = getString(R.string.agent_zhengce);
	      this.msg = getString(R.string.agent_zhengce_msg);
	      return;
	    case 3:
	  	  title = getString(R.string.agent_zhuce);
	  	  String str = getString(R.string.agent_zhuce_msg);
	    
	  	  String[] _Str = new String[3];
	  	  _Str[0] = Common.iAgentId;
	  	  _Str[1] = Common.iAgentId;
	  	  _Str[2] = Common.iAgentId;
	  	  msg = String.format(str, _Str);
	    }
	  }

	  private void setupView()
	  {
	    if ((title != null) && (msg != null))
	    {
	      ((TextView)findViewById(R.id.app_title_center)).setText(title);
	      ((TextView)findViewById(R.id.agent_msg)).setText(msg);
	    }
	    findViewById(R.id.title_btn4).setVisibility(View.INVISIBLE);
	    Button _Button = (Button)findViewById(R.id.title_btn1);
	    _Button.setText(R.string.app_back_tip);
	    _Button.setVisibility(View.VISIBLE);
	    _Button.setOnClickListener(new View.OnClickListener()
	    {
	      public void onClick(View paramAnonymousView)
	      {
	         finish();
	      }
	    });
	  }

	  protected void onCreate(Bundle savedInstanceState)
	  {
	    super.onCreate(savedInstanceState);
	    setContentView(R.layout.agent_detail);
	    type = getIntent().getIntExtra("TYPE", 1);
	    getString();
	    setupView();
	  }
}
